<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>今天是星期几？</title>
	</head>
	<body>
		<h2 id="day" align="center" > </h2>
		
		<script>
			
			var date=new Date().getDay();
			var h2=document.getElementById("day");
			
			
			
			var str = "今天是星期";

            switch (date){ 
            	case 0:
                str=str+"日";
                break;
                case 1:
                str=str+"一";
                break;
                case 2:
                str=str+"二";
                break;
                case 3:
                str=str+"三";
                break;
                case 4:
                str=str+"四";
                break;
                case 5:
                str=str+"五";
                break;
                case 6:
                str=str+"六";
                break; 
}
             h2.innerHTML=str;
			
		</script>
		
	</body>
	
</html>
